#pragma once
#include "define.h"
#include "grid.h"

struct FoamHeader
{
	string_t m_version;
	string_t m_format;
	string_t m_class;
	string_t m_location;
	string_t m_object;
	string_t m_arch;
	int label  = 32;
	int scalar = 64;
};

void readFoamHeader(std::ifstream& infile, FoamHeader& header);

void read_points(string_t fileName, int& nNodes, KNodePtr& nodes);

void read_faces(string_t fileName, int& nFaces, KFacePtr& faces, const KNodePtr& nodes);

void read_owner_neighbour(string_t fileName, int& nFaces, int* facecell, int& nCells);

void read_boudary(string_t fileName, KFacePtr& faces, std::vector<KBoundaryShaPtr> &boundaries);